#ifndef XRECEIVEVIDEO_H
#define XRECEIVEVIDEO_H
#include <opencv2/highgui.hpp>
#include <QThread>


class IReceiveVideoEvent
{
public:
    virtual void OnReceives(QImage image) = 0;
};




class XReceiveVideo: public QThread
{
public:
    XReceiveVideo();
    static XReceiveVideo *Get();
    virtual bool Init(const char* url) = 0; // 打开流
    virtual void Stop() = 0;

    void SetEvent(IReceiveVideoEvent * ob){mEvent = ob;}

    virtual ~XReceiveVideo();



protected:

    IReceiveVideoEvent *mEvent;
    // 处理线程退出的标志
    bool isExit = false;


    std::string murl;


};

#endif // XRECEIVEVIDEO_H
